<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery.min.js"></script>
    <style>

    </style>
</head>
<body>
    <button>点击</button>
    <input type="text">
    <script>
        $("button").click(function () {
            $(window).attr('location','./index.html');
        })
        var num = '';
        for(var i = 0 ; i < 6 ; i++){
            num+= Math.floor(Math.random()*10);
        }
        console.log(num)
        $("input").val(num)
        // var value =Math.floor(Math.random()*4000+1000);
        // console.log(value)
    </script>
</body>
</html>